<?php

session_start();

require("./config.php");
require("../config.php");
require("./functions.php");
require("../functions.php");
require("./content.php");

if(isset($_GET["accion"])){
	switch ($_GET["accion"]) {
		case "login":
			if(isset($_POST["usr"]) && isset($_POST["pass"])){
				if(login($_POST["usr"], $_POST["pass"])){
					$_SESSION["usuario"]=$_POST["usr"];
					$_SESSION["password"]=md5($_POST["pass"]);
				}
			}
			break;
		
		case "logout":
			session_unset();
			session_destroy();
			break;
		
		default:
			break;
	}
}

require($ADMIN["current_template"] . "config.php");
include($ADMIN["current_template"] . "index.php");

?>